home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / OpenDoc Development / Debugging Support / OpenDoc Source Code / Utilities / Interfaces / SEUtils.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-22  |  2.0 KB  |  80 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        SEUtils.h
  3.  
  4.     Contains:    Interface to Semantic Events Utility Functions
  5.  
  6.     Owned by:    Nick Pilch
  7.  
  8.     Copyright:    © 1993 - 1995 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     
  11.     In Progress:
  12.         
  13. */
  14.  
  15. #ifndef _SEUTILS_
  16. #define _SEUTILS_
  17.  
  18. #ifndef _ODTYPES_
  19. #include "ODTypes.h"
  20. #endif
  21.  
  22. #ifndef SOM_ODPart_xh
  23. #include "Part.xh"
  24. #endif
  25.  
  26. //#ifndef _SEMTINTF_
  27. //#include "SemtIntf.h"
  28. //#endif
  29.  
  30. // the type should determine how many bytes are moved....
  31.  
  32. class ODAppleEvent;
  33. class ODNameResolver;
  34. class ODOSLToken;
  35.  
  36. #define SETBYTESOFHANDLE(h,typ,data,skipbytes)                            \
  37.     *((typ*)((*(h))+(skipbytes))) = (data)                                \
  38.  
  39. #define GETBYTESOFHANDLE(h,typ,skipbytes)                                \
  40.     *((typ*)((*(h))+(skipbytes)))                                        \
  41.  
  42. #define SETFIRSTBYTESOFHANDLE(h,typ,data)                                \
  43.     SETBYTESOFHANDLE(h,typ,data,0)                                        \
  44.  
  45. #define FIRSTBYTESFROMHANDLE(h, typ)                                    \
  46.         GETBYTESOFHANDLE(h,typ,0)                                        \
  47.  
  48. const Boolean kFromTypeIsDesc = kODTrue;
  49. const Boolean kFromTypeIsPtr = kODFalse;
  50. const Boolean kIsSysHandler = kODTrue;
  51.  
  52. const ODSLong kODCountProcSwapValue = -1;
  53.  
  54. #define NULL_DESCRIPTOR_DEFINITION {typeNull, NULL}
  55.  
  56. extern "C" {
  57.  
  58. ODBoolean MissingParams(const AppleEvent* message);
  59. OSErr DecodeOrdinal(AEDesc ordData, long count, long* index,
  60.                     Boolean* allFlag, Boolean* zeroFlag);
  61. ODSLong GetSLongAttr(AppleEvent* ae, AEKeyword keyword);
  62. ODSLong GetSLongAttrOD(ODAppleEvent* ae, AEKeyword keyword);
  63.  
  64. // does an in-place coercion!
  65. void ThrowIfCantCoerce( AEDesc* data, DescType desiredType ) ;
  66. void ThrowIfNotAbsent( OSErr err ) ;
  67. ODSLong CountEmbeddedParts(Environment* ev, ODPart* prt);
  68.  
  69. void UpdateUserToken(Environment* ev, ODNameResolver* resolver,
  70.                         ODOSLToken* odToken, AEDesc* desc);
  71.     // Update the user token in odToken with data in desc. desc is disposed.
  72.  
  73. // do a double-dispose of AppleEvents that are copies of what might be
  74. // send-to-self events, since copies of these (eg. what you get when you
  75. // call ODDescToAEDesc) cannot be disposed with a single call to AEDisposeDesc.
  76. OSErr ODDisposeAppleEvent( AppleEvent* aevt );
  77. }
  78.  
  79. #endif // _SEUTILS_
  80.